socket-util: make sure flush_accept() doesn't hang on unexpected EOPNOTSUPP
authorLennart Poettering <lennart@poettering.net>
Thu, 18 Apr 2019 13:13:54 +0000 (15:13 +0200)
committerMichael Biebl <biebl@debian.org>
Thu, 29 Aug 2019 14:18:18 +0000 (15:18 +0100)
commitfb12fc9313ea0a6fc9b48a7a4f2cb7c6040ac81d
treeb87d95e9ef78691135f9d6b8178ce64372f4db70
parent794f56a5e4dfcc814d10ba6ee9a9acc65da5dfa5
socket-util: make sure flush_accept() doesn't hang on unexpected EOPNOTSUPP

So apparently there are two reasons why accept() can return EOPNOTSUPP:
because the socket is not a listening stream socket (or similar), or
because the incoming TCP connection for some reason wasn't acceptable to
the host. THe latter should be a transient error, as suggested on
accept(2). The former however should be considered fatal for
flush_accept(). Let's fix this by explicitly checking whether the socket
is a listening socket beforehand.

(cherry picked from commit f3d75364fbebf2ddb6393e54db5e10b6f6234e14)

Gbp-Pq: Name socket-util-make-sure-flush_accept-doesn-t-hang-on-unexpe.patch
src/basic/socket-util.c